
# Setup Breaking Change Detection in GitHub Pull Requests

<Admonition type="info">
  Breaking change detection ensures that your API does not break older SDKs.
</Admonition>

### Workflow Template

Copy the following template to `.github/workflows/konfig-detect-breaking-change.yaml` and configure the following values.

<CH.Section>
1. [Target branch](focus://5)
2. [Path to OAS](focus://22[71:90])

```yaml .github/workflows/konfig-detect-breaking-change.yaml
name: "konfig-detect-breaking-change"
on:
  pull_request:
    branches:
      - main
jobs:
  konfig-lint-openapi-spec:
    runs-on: ubuntu-latest
    env:
      CLI_VERSION: 1.0.181
    steps:
      - uses: actions/checkout@v3
      - name: Cache node_modules
        id: cache-npm
        uses: actions/cache@v3
        with:
          path: ~/.npm
          key: ${{ runner.os }}-build-${{ env.CLI_VERSION }}
      - name: Install Konfig CLI
        run: npm install -g konfig-cli@$CLI_VERSION
      - name: Detect breaking change
        run: konfig detect-breaking-change -m ${{github.base_ref}} -s path/to/openapi.yaml
```

</CH.Section>
